using System;
using System.IO;

namespace Pegasus.Diagnostics.Telnet
{
	/// <summary>
	/// Classes implement this interface to interface with the Pegasus Telnet Service
	/// This allow users to login to the telnet port and issue command to review
	/// or change the state of a running service.
	/// </summary>
	public interface ITelnetCommand
	{
		/// <summary>
		/// The names of the command that the user types in.
		/// </summary>
		string Command
		{
			get;
		}

		/// <summary>
		/// Any short cut commands or key (i.e. quit uses q and exit)
		/// </summary>
		string[] CommandShortCuts
		{
			get;
		}

		/// <summary>
		/// Execute the command.
		/// </summary>
		/// <param name="writer">Text stream to write to</param>
		/// <param name="args">Additional parameters that the user typed in.</param>
		void ExecCommand( TextWriter writer, string[] args );

		/// <summary>
		/// Show a single line of help about the command
		/// </summary>
		/// <returns>Single line brief description of command</returns>
		string GetHelp();

		/// <summary>
		/// Show a the full usage help about the command
		/// </summary>
		/// <param name="writer">Text stream to write to</param>
		void ShowDetailedHelp( TextWriter writer );
	}
}
